package com.xmlstrategys
{
	import com.strategy.IXML;
	import com.utils.Utils;
	
	import flash.utils.ByteArray;
	import flash.utils.Endian;
	
	public class XMLCSETInfo extends XMLBase implements IXML
	{
		public function XMLCSETInfo(data:XML)
		{
			super(data);
		}
		
		public function xmlstrategybml():ByteArray
		{
			var sourceByteArray:ByteArray = new ByteArray();
			sourceByteArray.endian = Endian.LITTLE_ENDIAN;
			var equipNum:int = xmlData.equipSets.length();
			sourceByteArray.writeUnsignedInt(equipNum);
			
			for each (var xml:XML in xmlData.equipSets){
				sourceByteArray.writeUnsignedInt(xml.@setId);
				Utils.writeString(xml.@setName,sourceByteArray);
				sourceByteArray.writeUnsignedInt(xml.@collectnum);
				Utils.writeList(xml.@collectInfoList1,sourceByteArray);
				Utils.writeList(xml.@collectInfoList2,sourceByteArray);
				Utils.writeList(xml.@collectInfoList3,sourceByteArray);
				Utils.writeList(xml.@collectInfoList4,sourceByteArray);
			}
			
			return sourceByteArray;
		}
	}
}